<template>
	<view class="container">
		<view class="top_box">
			<view class="userInfo" v-if="userInfo">
				<view class="user_pic">
					<image src="../../static/images/add.png" mode="aspectFill"></image>
				</view>
				<view class="user_name">
					{{userInfo.memberInfo.username}}
				</view>
			</view>
		</view>
		<view class="my_order">
			<view class="title">
				<view class="big">我的订单</view>
				<view class="small" @click="$gourl('/pages/index/order')">全部订单 <u-icon name="arrow-right" color="#999"
						size="28"></u-icon>
				</view>
			</view>
			<view class="icon_box">
				<view class="boxs" @click="$gourl('/pages/index/order?current=1')">
					<view class="icon">
						<image src="@/static/images/pMine/dfk.png" mode="heightFix"></image>
					</view>
					<view class="name">待付款</view>
				</view>
				<view class="boxs">
					<view class="icon">
						<image src="@/static/images/pMine/dfh.png" mode="heightFix"></image>
					</view>
					<view class="name" @click="$gourl('/pages/index/order?current=2')">待发货</view>
				</view>
				<view class="boxs">
					<view class="icon">
						<image src="@/static/images/pMine/dsh.png" mode="heightFix"></image>
					</view>
					<view class="name" @click="$gourl('/pages/index/order?current=3')">待收获</view>
				</view>
				<view class="boxs">
					<view class="icon">
						<image src="@/static/images/pMine/ywc.png" mode="heightFix"></image>
					</view>
					<view class="name" @click="$gourl('/pages/index/order?current=4')">已完成</view>
				</view>
			</view>
		</view>
		<view class="option_box">
			<view class="title">功能服务</view>
			<view class="option">
				<view class="list_box" @click="$gourl('/pages/index/capitalManage')">
					<view class="icon_box">
						<image src="@/static/images/pMine/zj.png" mode=""></image>
					</view>
					<view class="name">资金管理</view>
				</view>
				<view class="list_box" @click="$gourl('/pages/index/cardManage')">
					<view class="icon_box">
						<image src="@/static/images/pMine/kq.png" mode=""></image>
					</view>
					<view class="name">卡券管理</view>
				</view>
				<view class="list_box" @click="$gourl('/pages/address/addressList')">
					<view class="icon_box">
						<image src="@/static/images/pMine/dz.png" mode=""></image>
					</view>
					<view class="name">地址管理</view>
				</view>
				<view class="list_box">
					<view class="icon_box">
						<image src="@/static/images/pMine/kf.png" mode=""></image>
					</view>
					<view class="name">平台客服</view>
				</view>
				<view class="list_box">
					<view class="icon_box">
						<image src="@/static/images/pMine/rx.png" mode=""></image>
					</view>
					<view class="name">平台热线</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: null,
			}
		},
		onShow() {
			this.getData()
		},
		methods: {
			getData() {
				this.$allApi.getUserInfo().then(res => {
					console.log(res);
					this.userInfo = res.data
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.option_box {
		width: 690rpx;
		margin: 0 auto;
		background: #fff;
		border-radius: 20rpx;
		padding: 30rpx;
		box-shadow: 0 0 10rpx 0 #ccc;
		margin-top: 60rpx;

		.option {
			display: flex;
			align-items: center;
			justify-content: space-between;
			flex-wrap: wrap;

			.list_box {
				text-align: center;
				width: 25%;
				padding: 30rpx 0;
				padding-top: 60rpx;
				color: #666;

				.icon_box {
					image {
						width: 60rpx;
						height: 60rpx;
					}
				}
			}
		}

		.title {
			font-size: 32rpx;
		}
	}

	.my_order {
		width: 690rpx;
		margin: 0 auto;
		margin-top: -110rpx;
		background: #fff;
		border-radius: 20rpx;
		height: 232rpx;
		box-shadow: 0 0 10rpx 0 #ccc;

		.icon_box {
			display: flex;
			align-items: center;
			justify-content: space-between;

			.boxs {
				padding: 0 30rpx;

				.icon {
					text-align: center;

					image {
						width: 40rpx;
						height: 40rpx;
					}
				}
			}
		}

		.title {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 30rpx;

			.big {
				font-size: 32rpx;
			}

			.small {
				font-size: 28rpx;
				color: #999;
			}
		}
	}

	.top_box {
		background: url('../../static/images/pMine/mine_bg.png') no-repeat 100% center #fff;
		background-size: 100% 100%;
		height: 400rpx;
		display: flex;
		align-items: center;

		.userInfo {
			display: flex;
			align-items: center;
			padding: 30rpx;

			image {
				width: 140rpx;
				height: 140rpx;
				border-radius: 70rpx;
			}

			.user_name {
				font-size: 32rpx;
				color: #fff;
				font-weight: bold;
				padding-left: 20rpx;
			}
		}
	}


	// #ifdef H5
	.container {
		min-height: calc(100vh - 94px) !important;
	}

	// #endif
	.container {
		// padding: 30rpx 24rpx;
		min-height: 100vh;
		// background: #f7f8fc;
		padding-bottom: calc(100rpx + env(safe-area-inset-bottom));
	}
</style>